import vuels from 'vue-ls';
import lodash from 'lodash';
import Print from 'vue-print-nb';
import ElementUI from 'element-ui';
import ItsStorage from 'its-storage';
import Contextmenu from 'vue-contextmenujs'
import tinyEditor from '@/components/tinyEditor';
import swMoneyInput from '@/components/swMoneyInput';
import swSimpleUploader from '@/components/swSimpleUploader';

ElementUI.Dialog.props.closeOnClickModal.default = false;

export default {
	install(Vue) {
		Vue.use(Print);

		//加载ElementUI
		Vue.use(ElementUI);

		//加载富文本编辑器
		Vue.use(tinyEditor);

		//加载右键组件
		Vue.use(Contextmenu);

		//分片上传
		Vue.use(swMoneyInput);

		//分片上传
		Vue.use(swSimpleUploader);

		//lodash 方法
		Vue.prototype.$lodash = lodash;

		//本地存储开始
		Vue.prototype.$local = ItsStorage.create({ storage: 'local', namespace: 'sw_' })

		//会话存储
		Vue.prototype.$session = ItsStorage.create({ storage: 'session', namespace: 'sw_' })

		//内存存储
		Vue.use(vuels, { namespace: 'sw_', name: 'memory', storage: 'memory' })

	}
}